#!/usr/bin/perl
#
#
while($line=<STDIN>) {
	chomp($line);
	$line=~s/^\s*//g;
	($f,$del,$add,$gnp) = split(/\s+/,$line);
	
	if(! defined $lookUp{$del}->{$gnp}) {
		$lookUp{$del}->{$gnp} = $add;
	}
}


foreach $del (sort keys %lookUp) {
	foreach $gnp (sort keys %{$lookUp{$del}}) {
		print $del."\t".$gnp."\t".$lookUp{$del}->{$gnp}."\n";
	}
}
